<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Admin extends BIT_Controller
{
	function __construct() {
		parent::__construct();

		$this->header_views = array('admin/header');
		$this->footer_views = array('admin/footer');
		$this->load->library('adminlib');
		$this->load->database();

		$data['loggedin'] = $this->tank_auth->is_logged_in();
		$this->view_data['widgets'] = array(
			$this->load->view('widgets/loginwidget', $data, TRUE)
		);
	}
	
	public function index() {
		// Show admin home
		$this->v('admin/home');
	}
	public function produkter(){
		$this->view_data['products'] = $this->adminlib->getProductList();
		$this->v('admin/produkter/list');
	}
	public function produkter_edit($id){
		$this->view_data['product'] = $this->adminlib->getProduct($id);
		$this->v('admin/produkter/edit');
	}
}